<!--#layout("/common/layout.html",{"jsBase":"/js/cms/coreTestdata/"}){ -->
<layui:searchForm formId="searchForm"  condition="${search}">
</layui:searchForm>

<div class="layui-btn-group">
    <!--<layui:accessButton function="coreTestdata.add"  action="add">增加</layui:accessButton>-->
    <!--<layui:accessButton function="coreTestdata.del"  action="batchDel">删除</layui:accessButton>-->
</div>

<table id="coreTestdataTable" lay-filter="coreTestdataTable"></table>
<!--#} -->
<script>
layui.use(['index'], function(){
    var index = layui.index
    index.init();
});
function approval(id,remark,state){
    if(!remark){
        return Common.info("请输入备注！");
    }
    Common.post("/cms/coreTestdata/approval.json",{"id":id,'remark':remark,'state':state},function(data){
        window.dataReload();
        layer.closeAll();
        Common.info("操作成功");
    })
}
</script>
<script type="text/html" id="toobar">
    <a class="layui-btn layui-btn-xs" lay-event="detail">详情</a>
    <!--<a class="layui-btn layui-btn-xs"  lay-event="update">编辑</a>-->
    {{# if (d.state==0){}}
    <layui:accessButton function="cms.coreTestdata.approval"  action="approval">审核</layui:accessButton>
    {{# }else if (d.state==3){}}
    <layui:accessButton function="cms.coreTestdata.approval"  action="approvalReport">审核报告</layui:accessButton>
    {{# }if (d.state==3 || d.state==4 || d.state==6){}}
    <a class="layui-btn layui-btn-xs" href="/api/test.do?id={{d.id}}" target="_blank" lay-event="view">查看报告</a>
    {{# }}}
    {{# if (d.state==4){}}
    <a class="layui-btn layui-btn-xs" href="/cms/coreTestdata/qrCode.json?id={{d.id}}&name={{d.testName}}"  target="_blank">二维码</a>
    {{# }}}
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>